package vn.codespot.hms.task;

import vn.codespot.hms.model.request.StatusRequestModel;
import vn.codespot.hms.model.response.StatusResponseModel;
import android.content.Context;

public class CheckStatusTask extends AbstractTask {
    private ITaskListener mListener;

    private String mTrackingId;

    private StatusResponseModel mResp;

    public CheckStatusTask(Context context, ITaskListener listener, String trackingId) {
        super(context, "Checking status", "Cancel checking status");
        mListener = listener;
        mTrackingId = trackingId;
    }

    @Override
    protected void executes() {
        StatusRequestModel request = new StatusRequestModel();
        request.setTrackingId(mTrackingId);
        mResp = mService.getStatus(request);
    }

    @Override
    protected void finish() {
        mListener.finish(mResp);
    }
}
